<?php include_once ('function/check_login_function.php'); onlyValid(); onlyDoctor()?>
<!DOCTYPE html>
<html>
<head>
	<title>Admin</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="">
</head>
<body>
	<div id="wrap">
		<header>
		</header>
		<div id="main">
			<div id="menu">
			</div>
			<div id="content">
				
				<?php $logtype_list = DataLog::getDataLogTypeList(); ?>
					<?php if ($logtype_list !== null) {?>
					<table>
					<tr>
					<th>ID</th>
					<th>Type</th>
					<th></th>
					</tr>
					<?php 
						
							foreach ($logtype_list as $logtype) {
								echo '<tr>';
								echo '<td>' . $logtype['datalog_type_id'] . '</td>';
								echo '<td>' . $logtype['datalog_type_name'] . '</td>';
								echo '<td><a href="function/delete_logtype_function.php?id=' . $logtype['datalog_type_id'] . '">Delete</a></td>';
								echo '</tr>';
							}
						}
					?>
					</table>
					<form action="function/enter_logtype_function.php" method="POST">
				
					<input type="text" id="typename" name="typename" /> 
					<input type="submit" name="add" value="Add Type" /> <br /> 
					</form>
				
				<hr />

				<?php $notification_list = Notification::getNotificationTypeList(); ?>
					<?php if ($notification_list !== null) {?>
					<table>
					<tr>
					<th>ID</th>
					<th>Type</th>
					<th></th>
					</tr>
					<?php 
						
							foreach ($notification_list as $notification) {
								echo '<tr>';
								echo '<td>' . $notification['notification_type_id'] . '</td>';
								echo '<td>' . $notification['notification_type_name'] . '</td>';
								echo '<td><a href="function/delete_notificationtype_function.php?id=' . $notification['notification_type_id'] . '">Delete</a></td>';
								echo '</tr>';
							}
						}
					?>
					</table>
					<form action="function/enter_notificationtype_function.php" method="POST">
				
					<input type="text" id="typename" name="typename" /> 
					<input type="submit" name="add" value="Add Notification Type" /> <br /> 
					</form>
				
				<hr />
				
				<?php $hospital_list = Hospital::getHospitalList(); ?>
					<?php if ($hospital_list !== null) {?>
					<table>
					<tr>
					<th>ID</th>
					<th>Name</th>
					<th>Address</th>
					<th>Contact</th>
					<th></th>
					</tr>
					<?php 
						
							foreach ($hospital_list as $hospital) {
								echo '<tr>';
								echo '<td>' . $hospital['hospital_id'] . '</td>';
								echo '<td>' . $hospital['hospital_name'] . '</td>';
								echo '<td>' . $hospital['hospital_address'] . '</td>';
								echo '<td>' . $hospital['hospital_contact'] . '</td>';
								echo '<td><a href="function/delete_hospital_function.php?id=' . $hospital['hospital_id'] . '">Delete</a></td>';
								echo '</tr>';
							}
						}
					?>
					</table>					
					
					<form action="function/enter_hospital_function.php" method="POST">
					<label for="name"> Name: </label> 
					<input type="text" id="name" name="name" /> <br />
					<label for="address"> Address: </label> 
					<input type="text" id="address" name="address" /> <br />
					<label for="contact"> Contact: </label> 
					<input type="text" id="contact" name="contact" /> <br />
					<input type="submit" name="add" value="Add Hospital" /> <br /> 
					</form>			
					
					<hr />
					
			</div>
		</div>
		<footer>
			<div id="footer">
				
			</div>
		</footer>
	</div>
</body>